﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BCDto.FileManagement;
using BCService.FileManagement;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace BCTMSRESTful.Controllers.Management.System.ImageManagement
{
    /// <summary>
    /// 图片文件管理控制器
    /// </summary>
    [ApiExplorerSettings(GroupName = "Admin-SystemTools")]
    [Route("api/v1/sim/[controller]")]
    public class ImageManagementController : ManagementBaseController
    {
        private readonly IImageFileManagementService imageFileManagementService;

        public ImageManagementController(IImageFileManagementService imageFileManagementService)
        {
            this.imageFileManagementService = imageFileManagementService;
        }

        /// <summary>
        /// 获取系统图片文件目录
        /// </summary>
        /// <response code="200">返回系统图片文件管理列表（其中包含文件夹）。</response>
        /// <returns></returns>
        [HttpGet]
        [ProducesResponseType(typeof(IEnumerable<ImageFileManagementDto>), 200)]
        public IActionResult Get([FromQuery(Name = "path")]string path)
        {
            return this.Ok(this.imageFileManagementService.GetImageFolder(path));
        }
    }
}
